{extend name="pc/common/_base" /}

{block name="title"}
<title>mp3音频转换提取文字-在线音频提取文字免费试用-语音转文字平台-音频转换器在线-{$website['title']}</title>
{/block}

{block name="keywords"}
<meta name="keywords" content="音频转文字,音频转文字软件,在线音频提取文字免费试用,mp3音频转文字,mp3音频文字提取软件,语音转文字平台,{$website['title']}">
{/block}

{block name="description"}
<meta name="description" content="{$website['title']}音频转换器提供音频转（提取）文字功能,只需导入音频文件,即可快速准确地将音频文件内含有的语音信息进行识别（提取）并导出为文本文档,轻松完成音频转文字操作.">
{/block}

{block name="style"}
<style>
    .container .button-wrap {
        position: fixed;
        z-index: 900;
        left: 0;
        bottom: 0;
        width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
        background-color: #fff;
        max-width: unset !important;
        box-shadow: inset 0 1px 0 0 rgba(0, 0, 0, 0.08);
    }

    .container .button-wrap .button-content {
        min-height: 52px;
        margin: 0 auto;
        box-sizing: border-box;
        border-radius: 4px;
        position: relative;
        max-width: 1100px;
        padding: 20px 0;
        height: 80px;
        line-height: 80px;
        background: unset !important;
        box-shadow: unset !important;
    }

    .container .button-wrap .createOrdBtn {
        float: right;
        position: relative;
        top: 4px;
        right: 32px;
        width: 120px;
        height: 40px;
        text-align: center;
        background-color: #1e64ff;
        box-sizing: border-box;
        margin: -4px 0;
        line-height: 40px;
        border-radius: 4px;
        font-size: 14px;
        font-weight: 500;
        color: #FFFFFF;
        border: none;
        outline: none;
    }

    .container .button-wrap .createOrdBtn, .container .button-wrap .disableBtn {
        right: 0;
    }

    .disableBtn {
        float: right;
        position: relative;
        top: 4px;
        right: 32px;
        width: 120px;
        height: 40px;
        text-align: center;
        background: #F0F0F0;
        box-sizing: border-box;
        margin: -4px 0;
        line-height: 40px;
        border-radius: 4px;
        font-size: 16px;
        font-weight: 500;
        color: #C0C0C0;
        cursor: no-drop;
        border: none;
        outline: none;
        user-select: none;
    }

    .container .button-wrap .audio-msg-content {
        position: relative;
        top: 4px;
        float: right;
        font-size: 16px;
        font-weight: 400;
        color: rgba(0, 0, 0, 0.86);
        margin-right: 56px;
        line-height: 36px;
    }

    .container .button-wrap .audio-msg-content {
        margin-right: 24px;
    }

    .container .button-wrap .discountTip {
        min-width: 140px;
        line-height: 30px;
        height: 30px;
        padding: 0 24px;
        background: linear-gradient(140deg, #FFEADD 0%, #FFF8E4 100%);
        box-shadow: 0 0 4px 0 rgba(176, 183, 233, 0.2);
        font-size: 12px;
        font-weight: 400;
        border-radius: 14px;
        position: absolute;
        top: 25px;
        text-align: center;
        left: 0;
        /* display: none; */
    }

    .container .button-wrap .createOrdBtn .btn-newgift-tip {
        /* display: none; */
        position: absolute;
        right: 0;
        top: -9px;
        font-size: 12px;
        width: 84px;
        height: 20px;
        line-height: 20px;
        text-align: center;
        background-image: linear-gradient(90deg, #e8346f 0%, #ea524d 97%);
        border-radius: 10.5px 4px 4px 0;
    }

    .webuploader-pick {
        width: 100%;
        height: 100%;
    }

    .editer section .column-center .filesCon {
        height: 300px;
        overflow: auto;
    }

    .editer section .column-center .filesCon .fileItem .fileName {
        width: 100px;
    }

    .editer section .column-center .buttonCon {
        margin-bottom: 50px;
    }
</style>
{/block}

{block name="main"}

<div class="editer">

    <div class="container" id="app" v-cloak>

        <h1 class="editer-title">在线音频转文字</h1>
        <p class="editer-info">在线音频转文字工具一键即可提取音频内含有的文字信息</p>

        <section id="dragArea" class="upload-area J-upload-file exist-file">

            <!--<div class="file-border">
                <input id="pick0" type="file" accept=".mp3,.m4a,.wma,.aac,.flac,.ac3,.m4r,.ape,.ogg,.wav" multiple="multiple" class="pick">

                <div id="filepick" class="pick-btn"><span class="iconfont icon-add"></span> 点击添加文件</div>

                <div class="operate">点击或拖拽添加音频</div>
                <div class="operate">请上传需要转换的音频文件，最大支持1G，</div>
                <div class="guide">支持MP3,M4A,WMA,AAC,FLAC,AC3,M4R,APE,OGG,WAV格式</div>
            </div>-->

            <div class="column-center">

                <div class="filesCon" v-if="voiceList.length > 0">
                    <div class="column-center fileItem" v-for="(item,index) in voiceList" v-key="index">
                        <img src="{$moduleAttachUrl}/static/images/icon/audio-item.png" alt="" class="fileImg"> <span class="fileName">{{ item.name }}</span>
                        <div><img src="{$moduleAttachUrl}/static/images/icon/shanchu.png" alt="" class="deleteIcon"></div>
                        <div class="transState" style="display: none;"><img src="{$moduleAttachUrl}/static/images/icon/cg.png" alt=""> <span class="transStateText">转换成功</span></div>
                        <div class="transState" style="display: none;"><img src="{$moduleAttachUrl}/static/images/icon/fail.png" alt=""> <span class="transStateText">转换失败</span></div>
                    </div>
                </div>

                <div class="buttonCon file-border" style="height: auto;">

                    <div class="flex-center" style="width: 100%;">
                        <label id="filepick1" class="pick-btn1">点击添加文件</label>
                        <div class="pick-btn-go" style="margin-left: auto;" v-if="voiceList.length > 0" @click="doUpload()">开始转换</div><!--disabled-->
                    </div>

                    <audio id="player2" width="100" height="50" autoplay="autoplay"></audio>

                    <template v-if="voiceList.length <= 0">
                        <div class="operate">点击或拖拽添加音频</div>
                        <div class="operate">请上传需要转换的音频文件，最大支持1G，</div>
                        <div class="guide">支持MP3,M4A,WMA,AAC,FLAC,AC3,M4R,APE,OGG,WAV格式</div>
                    </template>

                </div>
            </div>

        </section>

        <div class="convert-setting">
            <div class="setting-checkbox">
                <div class="label">输出格式：</div>
                <div role="group" aria-label="checkbox-group" class="el-checkbox-group">
                    <label class="el-checkbox">
                        <span class="el-checkbox__input">
                            <span class="el-checkbox__inner"></span>
                            <input type="checkbox" aria-hidden="false" value="txt" class="el-checkbox__original">
                        </span>
                        <span class="el-checkbox__label"> TXT </span>
                    </label>
                    <label class="el-checkbox">
                        <span class="el-checkbox__input">
                            <span class="el-checkbox__inner"></span>
                            <input type="checkbox" aria-hidden="false" value="docx" class="el-checkbox__original">
                        </span>
                        <span class="el-checkbox__label is-disabled"> WORD </span>
                    </label>
                    <label class="el-checkbox">
                        <span class="el-checkbox__input is-disabled">
                            <span class="el-checkbox__inner"></span>
                            <input type="checkbox" aria-hidden="false" value="srt" class="el-checkbox__original" disabled>
                        </span>
                        <span class="el-checkbox__label"> SRT </span>
                    </label>
                </div>
            </div>

        </div>


        <!--https://www.iflyrec.com/html/addMachineOrder.html-->
        <!--https://app.xunjieshipin.com/audio-to-text/-->

        <div class="button-wrap" v-if="voiceList.length">
            <div class="button-content">
                <p class="J-discountTip discountTip">新用户<span>免费体验15分钟</span></p>

                <button id="J-create-order-button" style="" class="a-button createOrdBtn" data-track="中文机器_确认订单">提交转写
                    <span class="btn-newgift-tip">下单立享优惠</span>
                </button>
                <button id="J-disable-create-order-button" class="disableBtn" data-track="中文机器_确认订单" style="display: none;">提交转写</button>

                <div class="audio-msg-content">
                    <span class="J-file-number file-number">共<span>{{ voiceList.length }}</span>条音频，</span>
                    <span class="audio-msg-name">总时长：</span>
                    <span class="J-audio-msg-duration audio-msg-duration">00:14:00</span>
                </div>
            </div>
        </div>

    </div>

</div>

<div class="editer-desc">
    <div class="container">

        <div class="convert-step w1200">
            <div class="step-item">
                <div class="step">
                    <img src="{$moduleAttachUrl}/static/images/icon/add_audio.png">
                    <div class="stepinfo"><p class="steptitle">添加音频</p>
                        <p class="steptext">添加好需要转文字的音频文件</p>
                    </div>
                </div>
                <div class="next">
                    <img src="{$moduleAttachUrl}/static/images/icon/right-arrow.png" alt="">
                </div>
            </div>
            <div class="step-item">
                <div class="step">
                    <img src="{$moduleAttachUrl}/static/images/icon/upload_audio.png">
                    <div class="stepinfo">
                        <p class="steptitle">音频提取</p>
                        <p class="steptext">设定转文字的相关参数，单击“开始转换”按钮处理文件</p>
                    </div>
                </div>
                <div class="next">
                    <img src="{$moduleAttachUrl}/static/images/icon/right-arrow.png" alt="">
                </div>
            </div>
            <div class="step-item">
                <div class="step">
                    <img src="{$moduleAttachUrl}/static/images/icon/down_text.png">
                    <div class="stepinfo">
                        <p class="steptitle">保存文字</p>
                        <p class="steptext">稍等片刻后点击“立即下载”按钮保存处理好的文字信息</p>
                    </div>
                </div>
            </div>
        </div>

        <div class="edit-introduction w1200">
            <div class="intritem"><img src="{$moduleAttachUrl}/static/images/icon/audio_to_text1.png" alt="音频批量转文字">
                <div class="intrbox"><p class="intrtitle">音频批量转文字</p>
                    <p class="intrcontent">在线音频转文字功能，可一次性添加多个需要进行转文字处理的音频文件，并对添加好的音频进行批量转文字处理，快速完成音频转文字操作。</p></div>
            </div>
            <div class="intritem"><img src="{$moduleAttachUrl}/static/images/icon/audio_to_text2.png" alt="兼容多种音频格式">
                <div class="intrbox"><p class="intrtitle">兼容多种音频格式</p>
                    <p class="intrcontent">在线音频转文字网站支持添加mp3、m4a、aac、flac、wav等多种常见的音频格式，并自动识别音频格式，即可对常见的音频格式进行转文字操作。</p></div>
            </div>
            <div class="intritem"><img src="{$moduleAttachUrl}/static/images/icon/audio_to_text3.png" alt="适用于不同场景">
                <div class="intrbox"><p class="intrtitle">适用于不同场景</p>
                    <p class="intrcontent">在线音频转文字工具可将识别好的文字保存为TXT、WORD、SRT格式，可用于制作视频字幕、会议纪要、采访记录、课堂记录等。</p></div>
            </div>
            <div class="intritem"><img src="{$moduleAttachUrl}/static/images/icon/audio_to_text4.png" alt="一站式文件处理">
                <div class="intrbox"><p class="intrtitle">一站式文件处理</p>
                    <p class="intrcontent">在线网站除了音频转文字操作外，还带有音视频格式互转、视频编辑、在线录制、在线压缩等常见的文件处理操作，轻松满足您多样化的文件处理需求</p></div>
            </div>
            <div class="intritem"><img src="{$moduleAttachUrl}/static/images/icon/volume5.png" alt="隐私安全有保护">
                <div class="intrbox"><p class="intrtitle">隐私安全有保护</p>
                    <p class="intrcontent">为保护您的隐私安全，您音频转文字所上传的音频文件会在1小时后自动删除，只有您在制作过程中能查阅该文件，无需担心隐私安全问题。</p></div>
            </div>
        </div>


    </div>
</div>

<div class="container" style="margin-top: 60px">
    <div class="recommend-box">
        {include file='pc/common/app'}
    </div>
</div>

{/block}

{block name="script"}

<script>
    window.XFTJ_OpenTime = false;

    require(['vue', "webuploader", "jquery", "tip"], (Vue, WebUploader, $) => {

        new Vue({
            el: '#app',
            data: {
                voiceList: [],
                uploader:null
            },
            mounted() {
                this.$nextTick(() => {
                    // this.getUploadMax('filepick');
                    this.getUploadMax('filepick1');
                });

            },
            methods: {
                doUpload(){
                    tip.msgbox.err('暂不支持上传文件');
                    // this.uploader.upload();
                },
                getUploadMax(Obj) {
                    let This = this;
                    let uploadMax = 100;

                    let options = {
                        // 选完文件后，是否自动上传。
                        auto: false,
                        // 不压缩image
                        resize: false,
                        // swf文件路径
                        swf: "{$moduleAttachUrl}/static/components/webuploader/Uploader.swf?_=" + new Date().getTime(),
                        // 文件接收服务端。
                        server: "{:url('/tool/upload',['fileType' => '3'])}",
                        // 选择文件的按钮。可选。
                        // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                        pick: '#' + Obj,
                        chunked: false,// 开启分片上传
                        fileSingleSizeLimit: 2147483648,//524288000,   //500M
                        fileNumLimit: uploadMax,
                        timeout: 0,
                        dnd: 'body',
                        accept: {
                            title: 'Videos',
                            extensions: 'pcm,wav,mp3,m4a,amr,wma,mp4,3gp,aac',
                            mimeTypes: '.pcm,.wav,.mp3,.m4a,.amr,.wma,.mp4,.3gp,.aac'
                        },
                        duplicate: false,
                    };

                    This.uploader = WebUploader.create(options);

                    This.uploader.on('uploadBeforeSend', function (object, data, headers) {
                        // headers[''] = '';
                    });

                    This.uploader.on('uploadStart', function (file) {
                        console.log('uploadStart', file);
                    });

                    // 当有文件添加进来的时候
                    This.uploader.on('fileQueued', function (file) {
                        console.log('fileQueued', file);
                        This.voiceList.push({
                            'id': file.id,
                            'ext': file.ext,
                            'name': file.name,
                            'size': file.size,
                            'type': file.type,
                        });

                        console.log('voiceList', This.voiceList);
                    });

                    // 文件上传过程中创建进度条实时显示。
                    This.uploader.on('uploadProgress', function (file, percentage) {
                        console.log('uploadProgress', percentage);
                    });

                    This.uploader.on('uploadSuccess', function (file, response) {
                        console.log('uploadSuccess', response);
                    });

                    This.uploader.on('uploadError', function (file) {
                        console.log('uploadError', file);
                    });

                    This.uploader.on('uploadAccept', function (file, response) {
                        console.log('uploadAccept', response);
                    });

                    This.uploader.on("error", function (type) {
                        if (type == "Q_TYPE_DENIED") {
                            tip.msgbox.err("当前不支持所选文件格式，请确认文件格式后重新上传");
                        } else if (type == "F_EXCEED_SIZE") {
                            tip.msgbox.err("当前不支持单个音频文件超过2G，请重新选择文件后上传");
                        } else if (type == "F_DUPLICATE") {
                            tip.msgbox.err('相同文件名已存在');
                        } else if (type == "Q_EXCEED_NUM_LIMIT") {
                            tip.msgbox.err("选择文件数量超出限制,当前只保留前 " + uploadMax + " 条音频");
                        }
                    });

                    This.uploader.on('uploadComplete', function (file) {
                        // $( '#'+file.id ).find('.progress').fadeOut();
                    });

                    This.uploader.on('all', function (type) {
                        if (type === 'startUpload') {
                            // state = 'uploading';
                        } else if (type === 'stopUpload') {
                            // state = 'paused';
                        } else if (type === 'uploadFinished') {
                            // state = 'done';
                        }
                    });

                    // uploader.stop();
                    // uploader.upload();
                }

            }
        });
    });
</script>
{/block}